import { createRouter, createWebHistory } from 'vue-router'
import Login from '../pages/login/login.vue'
import Tabs from '../pages/tabs/index.vue'
import Project from '../pages/tabs/project/project.vue'
import Customer from '../pages/tabs/customer/customer.vue'
import User from '../pages/tabs/user/user.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: Tabs,
      redirect: '/tabs/project',
      children: [
        {
          path: 'tabs/project',
          name: 'project',
          component: Project,
        },
        {
          path: 'tabs/customer',
          name: 'customer',
          component: Customer,
        },
        {
          path: 'tabs/user',
          name: 'user',
          component: User,
        },
      ],
    },
    {
      path: '/login',
      name: 'loginPage',
      component: Login,
    },
    {
      path: '/tabs',
      redirect: '/tabs/project',
    },
  ],
})

export default router
